from jinja2 import Template

template = Template('{% for x in range(10) %}  {{x}} Hello {{ name }}!\n{% endfor %}')

print(template.render(name='John Doe'))

template01 = Template('{% raw %} {% for x in range(10) %} Hello {{ name }}! {% endfor %}{% endraw %}\n')

print(template01.render(name='greewarm'))

template02=Template('''
{%- for href, caption in [('index.html', 'Index'), ('about.html', 'About'),('downloads.html', 'Downloads')] -%}
<li><a href="{{ href }}">{{ caption }}</a></li>
{% endfor %}
''')
print(template02.render())